#!/usr/bin/python  
#-*- coding:utf-8 -*-  
############################  
#File Name: zab.py
#Author: Timy.Huang 
#Mail: timy.huang@foxmail.com  
#Created Time: 2017-06-03 14:50:07
############################  

import sys, base64
import xml.etree.ElementTree as ET

import itu

def handle( root_node ):
    moduleName = root_node.attrib.get( "module", None )
    funName = root_node.attrib.get( "fun", None )
    if not moduleName or not funName:
        return "except: object has not attribute module or fun"
    module = __import__( moduleName )
    fun = getattr( module, funName )
    return fun( root_node ) 

if __name__ == "__main__":
    stdin = base64.b64decode( sys.argv[1] )
    root_node = ET.fromstring( stdin )
    try:
        print base64.b64encode( handle( root_node ) )
        print error
    except Exception,e:
        print base64.b64encode( "except: " + e.message )
